# SlideScript makefile
# (C) Copyright 2014-2022 Chris Dorman, some rights reserved (GPLv2)
# Some changes and tweaks from Menchers

VERSION       = \"0.7.2\"
VERSION_EXTRA = \"$(EXTRA)\"

PREFIX ?= /usr

#CC           ?= musl-gcc
CC           ?= gcc
#CC           ?= tcc
#CC           ?= musl-tcc
CFLAGS       += -O3 -g -Wall -Wextra
CPPFLAGS     += -DVERSION=$(VERSION) -D_FORTIFY_SOURCE=2
#CPPFLAGS     += -DVERSION=$(VERSION)
LDFLAGS      += -lm
BIN          ?= slidescript

SRCS=$(wildcard src/lz78/*.c) $(wildcard src/*.c)

OBJECTS=$(SRCS:%.c=%.o)


all: main

fresh: clean all

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

main: $(OBJECTS)
	$(CC) $(OBJECTS) -o $(BIN) $(LDFLAGS) $(CFLAGS)
	
clean:
	rm -f $(OBJECTS) $(BIN)
	
install:
	install -D $(BIN) $(DESTDIR)/$(PREFIX)/bin/$(BIN)
